package com.imooc.productdataservice2.controller;

import com.imooc.productdataservice2.pojo.product;
import com.imooc.productdataservice2.service.productservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: springcloud_demo
 * @description:
 * @author: ZhangKai
 * @create: 2019-09-17 16:43
 **/

@RestController
public class productcontroller {

    @Autowired
    private productservice productservice;

    @RequestMapping("/products")
    public Object products() {
        List<product> ps = productservice.listProducts();
        return ps;
    }
}
